﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Beway.ValueAdded.Model
{
    public class XMLHead
    {
        public static string MessageHeadXml(string bipCode, string actCode)
        {
            DateTime dt = DateTime.Now;
            string seq = dt.ToString("yyMMddHHmmss");
            string orderSeqID = "BWHD" + dt.ToString("yyyyMMddHHmmss") + seq;
            //string bipCode = "BIP4B876";
            //string actCode = "T4011137";
            string sessionID = "RE" + beway.common.FileUtil.GetFileNameFromSystemAuto();
            string tranIDO = orderSeqID;
            string tranTime = dt.ToString("yyyyMMddHHmmss");

            string msgHead = "<?xml version='1.0' encoding='UTF-8'?>" +
                            "<InterBOSS>" +
                            "<Version>0100</Version>" +
                            "<TestFlag>0</TestFlag>" +
                            "<BIPType>" +
                            "<BIPCode>" + bipCode + "</BIPCode>" +
                            "<ActivityCode>" + actCode + "</ActivityCode>" +
                            "<ActionCode>0</ActionCode>" +
                            "</BIPType>" +
                            "<RoutingInfo>" +
                            "<OrigDomain>DOMS</OrigDomain>" +
                            "<RouteType>00</RouteType>" +
                            "<Routing>" +
                            "<HomeDomain>BBSS</HomeDomain>" +
                            "<RouteValue>998</RouteValue>" +
                            "</Routing>" +
                            "</RoutingInfo>" +
                            "<TransInfo>" +
                            "<SessionID>" + sessionID + "</SessionID>" +
                            "<TransIDO>" + tranIDO + "</TransIDO>" +
                            "<TransIDOTime>" + tranTime + "</TransIDOTime>" +
                            "</TransInfo>" +
                            "</InterBOSS>";
            return msgHead;
        }
    }
}
